# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=ostree
pkgver=2020.4
pkgrel=0
pkgdesc="Operating system and container binary deployment and upgrades"
url="https://github.com/ostreedev/ostree"
arch="all"
license="LGPL-2.0-or-later"
makedepends="bison glib-dev xz-dev libarchive-dev e2fsprogs-dev
	libsoup-dev gpgme-dev fuse-dev linux-headers gtk-doc libxslt
	automake autoconf libtool"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-dbg
	$pkgname-bash-completion:bashcomp:noarch
	"
source="https://github.com/ostreedev/ostree/releases/download/v$pkgver/libostree-$pkgver.tar.xz
	musl-fixes.patch
	"
options="!check"
builddir="$srcdir/lib$pkgname-$pkgver"

prepare() {
	default_prepare
	NOCONFIGURE=1 ./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--sbindir=/usr/bin \
		--libexecdir=/usr/lib \
		--enable-gtk-doc \
		--disable-static \
		--disable-glibtest
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	amove usr/share/bash-completion
}

sha512sums="e1488fda145b2266fd73ebaf272ce35085e578bae55044498bb3b7e94bf18f64f0917f089df4981b199c35601e2f3391fe4423601dee25f5c2e18d5c18d7ead1  libostree-2020.4.tar.xz
affde3a0a1c27066c2fcc30212343274de9b3856e913adc340afa4fbfb6398732c4c39dee52837459a77273015aec4e98ea61c2b5e3e884b795462485657933c  musl-fixes.patch"
